home *** CD-ROM | disk | FTP | other *** search
/ Libris Britannia 4 / science library(b).zip / science library(b) / ASTRNOMY / AA_51.ZIP / EPSILN.C < prev    next >
C/C++ Source or Header  |  1993-02-09  |  2KB  |  66 lines

  1. /* Obliquity of the ecliptic at Julian date J
  2.  *
  3.  * IAU Coefficients are from:
  4.  * J. H. Lieske, T. Lederle, W. Fricke, and B. Morando,
  5.  * "Expressions for the Precession Quantities Based upon the IAU
  6.  * (1976) System of Astronomical Constants,"  Astronomy and Astrophysics
  7.  * 58, 1-16 (1977).
  8.  *
  9.  * Before or after 200 years from J2000, the formula used is from:
  10.  * J. Laskar, "Secular terms of classical planetary theories
  11.  * using the results of general theory," Astronomy and Astrophysics
  12.  * 157, 59070 (1986).
  13.  *
  14.  *  See precess.c and page B18 of the Astronomical Almanac.
  15.  * 
  16.  */
  17.  
  18. /* The results of the program are returned in these
  19.  * global variables:
  20.  */
  21. double jdeps = -1.0; /* Date for which obliquity was last computed */
  22. double eps = 0.0; /* The computed obliquity in radians */
  23. double coseps = 0.0; /* Cosine of the obliquity */
  24. double sineps = 0.0; /* Sine of the obliquity */
  25. extern double eps, coseps, sineps, STR;
  26.  
  27. int epsiln(J)
  28. double J; /* Julian date input */
  29. {
  30. double T;
  31. double sin(), cos(), fabs();
  32.  
  33. if( J == jdeps )
  34.     return(0);
  35. T = (J - 2451545.0)/36525.0;
  36.  
  37. /* This expansion is from the AA.
  38.  * Note the official 1976 IAU number is 23d 26' 21.448", but
  39.  * the JPL numerical integration found 21.4119".
  40.  */
  41. if( fabs(T) < 2.0 )
  42.     eps = (((1.813e-3*T - 5.9e-4)*T - 46.8150)*T + 84381.448)*STR;
  43.  
  44. /* This expansion is from Laskar, cited above.
  45.  * Bretagnon and Simon say, in Planetary Programs and Tables, that it
  46.  * is accurate to 0.1" over a span of 6000 years. Laskar estimates the
  47.  * precision to be 0.01" after 1000 years and a few seconds of arc
  48.  * after 10000 years.
  49.  */
  50. else
  51.     {
  52.     T /= 10.0;
  53.     eps = ((((((((( 2.45e-10*T + 5.79e-9)*T + 2.787e-7)*T
  54.         + 7.12e-7)*T - 3.905e-5)*T - 2.4967e-3)*T
  55.     - 5.138e-3)*T + 1.99925)*T - 0.0155)*T - 468.093)*T
  56.     + 84381.448;
  57.     eps *= STR;
  58.     }
  59.  
  60. coseps = cos( eps );
  61. sineps = sin( eps );
  62. jdeps = J;
  63. return(0);
  64. }
  65.  
  66.